<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8"/>
	<meta name="baidu-site-verification" content="JdMif0g2tL" />
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
	<title>angular</title>
	<script src="js/angular.min.js" charset="utf-8"></script>
</head>
<style type="text/css" media="screen">
	*{margin:0;padding: 0;font-size: 16px;}
</style>
<body ng-app="myApp">

<div ng-controller="appCtrl">
	<input ng-model="msg">
	<h1>{{msg | toCamel : true}}</h1>
	<h1>{{msg | toCamel | lowercase}}</h1>
</div>	

<script type="text/javascript">
	var app =angular.module('myApp', []);
	//驼峰命名过滤器，并且这个过滤器会根据传递参数决定首字母是否大写
	//abd_efc_hij=>abdefchij
	app.filter('toCamel',function(){
		return function(data,firtCharToUpper){
			if(firtCharToUpper){
				data=data.replace(/^([a-z])/,function(match,$1){
					return $1.toUpperCase()
				})
			}
			return data.replace(/\_(\w)/g,function(match,$1){
				return $1.toUpperCase()
			});
		}
	});
	app.controller('appCtrl', ['$scope', function($scope){
		$scope.msg='hello';
		
	}])
</script>
<script type="text/javascript">
	document.getElementsByTagName('html')[0].style.fontSize=window.screen.width/10+'px';
</script>
</body>
</html>
<!--应该 6.6-->